﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.CompilerServices;
namespace BE.Configuracion
{
    [assembly: InternalsVisibleTo("BC")]
    public class FuncionBE
    {
        public int iModuleId{get;set;}
		public string sModuleName{get;set;}
		public string sDescription{get;set;}
		public int iMenuItemId{get;set;}
		public string sMenuName{get;set;}
		public string sMenuDescription{get;set;}
		public string sPage{get;set;}

        public FuncionBE()
        {
            this.iModuleId = -1;
            this.iMenuItemId = -1;
            this.sDescription = string.Empty;
            this.sModuleName = string.Empty;
            this.sPage = string.Empty;
            this.sMenuName = string.Empty;
            this.sMenuDescription = string.Empty;
        }

        internal List<FuncionBE> GetListByModulo()
        {
            List<FuncionBE> result = new List<FuncionBE>();
            try
            {
                using (DAL.Configuration.ModulosDAL<FuncionBE> db = new DAL.Configuration.ModulosDAL<FuncionBE>())
                {
                    result = db.GetFunctionsList(this.iModuleId);
                }
            }
            catch(Exception ex)
            {
                throw new Exception("BE.Configuracion - FuncionBE - GetListByModulo - ",ex);
            }
            return result;
        }
    }
}
